load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")
load(
    "@fbsource//arvr/tools/build_defs:embed_resources.bzl",
    "embed_resources",
)

oncall("fboss_agent_push")

cpp_library(
    name = "config_factory",
    srcs = [
        "ConfigFactory.cpp",
        "HwPortUtils.cpp",
        "HwSwitchEnsemble.cpp",
        "HwSwitchEnsembleRouteUpdateWrapper.cpp",
        "StaticL2ForNeighborHwSwitchUpdater.cpp",
    ],
    exported_deps = [
        "//fboss/agent:apply_thrift_config",
        "//fboss/agent:asic_utils",
        "//fboss/agent:core",
        "//fboss/agent:fboss-error",
        "//fboss/agent:fboss-types",
        "//fboss/agent:hw_asic_table",
        "//fboss/agent:hw_switch",
        "//fboss/agent:hwagent",
        "//fboss/agent:hwswitchcallback",
        "//fboss/agent:packet",
        "//fboss/agent:platform_base",
        "//fboss/agent:split_agent_thrift_syncer",
        "//fboss/agent:sw_switch_warmboot_helper",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent:switchid_scope_resolver",
        "//fboss/agent:tx_packet_utils",
        "//fboss/agent:utils",
        "//fboss/agent/hw:hardware_stats-cpp2-types",
        "//fboss/agent/hw/switch_asics:switch_asics",
        "//fboss/agent/if:ctrl-cpp2-types",
        "//fboss/agent/platforms/tests/utils:test_platform_types",
        "//fboss/agent/rib:fib_updater",
        "//fboss/agent/rib:standalone_rib",
        "//fboss/agent/state:state",
        "//fboss/agent/test:linkstate_toggler",
        "//fboss/agent/test:multiswitch_test_server",
        "//fboss/agent/test:route_distribution_gen",
        "//fboss/agent/test:test_ensemble_if",
        "//fboss/agent/test/utils:acl_test_utils",
        "//fboss/agent/test/utils:config_utils",
        "//fboss/agent/test/utils:pkt_test_utils",
        "//fboss/lib/config:fboss_config_utils",
        "//fboss/lib/phy:phy-cpp2-types",
        "//fboss/qsfp_service/if:transceiver-cpp2-types",
        "//folly:network_address",
        "//folly:synchronized",
        "//folly/executors:function_scheduler",
        "//folly/gen:base",
        "//folly/logging:logging",
    ],
)

cpp_unittest(
    name = "counter_utils_test",
    srcs = [
        "CounterUtilsTests.cpp",
    ],
    deps = [
        "//common/stats:service_data",
        "//common/stats:thread_cached_service_data",
        "//fboss/agent/hw:counter_utils",
        "//fboss/agent/hw:hardware_stats-cpp2-types",
    ],
)

cpp_unittest(
    name = "hw_port_fb303_stats_test",
    srcs = [
        "HwPortFb303StatsTests.cpp",
        "HwSysPortFb303StatsTests.cpp",
    ],
    deps = [
        "//fb303:service_data",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent/hw:hw_port_fb303_stats",
        "//fboss/agent/hw:stats_constants",
        "//folly/logging:logging",
    ],
)

cpp_unittest(
    name = "hw_cpu_fb303_stats_test",
    srcs = [
        "HwCpuFb303StatsTests.cpp",
    ],
    deps = [
        "//fb303:service_data",
        "//fboss/agent/hw:hw_cpu_fb303_stats",
        "//fboss/agent/hw:stats_constants",
        "//folly/logging:logging",
    ],
)

cpp_unittest(
    name = "hw_resource_stats_publisher_test",
    srcs = [
        "HwResourceStatsPublisherTest.cpp",
    ],
    deps = [
        "//fb303:service_data",
        "//fboss/agent/hw:hardware_stats-cpp2-types",
        "//fboss/agent/hw:hw_resource_stats_publisher",
    ],
)

cpp_library(
    name = "hw_test_main",
    srcs = [
        "Main.cpp",
    ],
    exported_deps = [
        "fbsource//third-party/googletest:gtest",
        "//fboss/agent:fboss_init",  # @manual
        "//fboss/agent:fboss_init_h",
        "//folly/init:init",
        "//folly/logging:init",
        "//folly/logging:logging",
    ],
)

cpp_library(
    name = "hw_test_packet_snooper",
    srcs = [
        "HwTestPacketSnooper.cpp",
    ],
    exported_deps = [
        ":config_factory",
        "//fboss/agent:hwswitchcallback",
        "//fboss/agent:packet",
        "//fboss/agent/packet:packet_factory",
        "//fboss/agent/packet:pktutil",
        "//fboss/agent/test/utils:packet_snooper",
        "//folly:optional",
        "//folly/io:iobuf",
    ],
)

cpp_library(
    name = "hw_test_learning_update_observer",
    srcs = [
        "HwTestLearningUpdateObserver.cpp",
    ],
    exported_deps = [
        ":config_factory",
        "//fboss/agent:core",
        "//fboss/agent:hwswitchcallback",
        "//fboss/agent/packet:packet_factory",
        "//folly:optional",
    ],
)

cpp_library(
    name = "hw_test_linkscan_update_observer",
    srcs = [
        "HwTestLinkScanUpdateObserver.cpp",
    ],
    exported_deps = [
        ":config_factory",
    ],
)

cpp_library(
    name = "hw_packet_utils",
    srcs = [
        "HwTestPacketUtils.cpp",
    ],
    exported_deps = [
        "//common/logging:logging",
        "//fboss/agent:core",
        "//fboss/agent:fboss-types",
        "//fboss/agent:hw_switch",
        "//fboss/agent:packet",
        "//fboss/agent/packet:packet",
        "//fboss/agent/packet:packet_factory",
        "//fboss/agent/state:state",
        "//fboss/agent/test:resourcelibutil",
        "//fboss/agent/test:utils",
        "//fboss/agent/test/utils:pkt_test_utils",
        "//folly:network_address",
        "//folly:range",
        "//folly/io:iobuf",
    ],
)

cpp_library(
    name = "hw_copp_utils",
    srcs = [
        "HwTestCoppUtils.cpp",
    ],
    undefined_symbols = True,
    exported_deps = [
        "fbsource//third-party/googletest:gtest",
        ":hw_packet_utils",
        "//fboss/agent:fboss-types",
        "//fboss/agent:hw_switch",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent/hw:hardware_stats-cpp2-types",
        "//fboss/agent/hw/switch_asics:switch_asics",
        "//fboss/agent/state:state",
        "//fboss/agent/test/utils:copp_test_utils",
        "//folly:network_address",
        "//folly/logging:logging",
    ],
)

cpp_unittest(
    name = "packet_util_tests",
    srcs = [
        "PacketUtilTests.cpp",
    ],
    deps = [
        ":hw_packet_utils",
        "//fboss/agent/hw/mock:mock",
        "//fboss/agent/packet:packet",
        "//fboss/agent/packet:packet_factory",
        "//fboss/agent/packet:pktutil",
        "//fboss/agent/test:utils",
        "//folly/io:iobuf",
    ],
)

cpp_unittest(
    name = "hw_switch_ensemble_tests",
    srcs = [
        "unittests/HwSwitchEnsembleTests.cpp",
    ],
    deps = [
        ":config_factory",
    ],
)

cpp_library(
    name = "hw_qos_utils",
    srcs = [
        "dataplane_tests/HwTestQosUtils.cpp",
    ],
    undefined_symbols = True,  # remove this when _DEPRECATED apis are retired
    exported_deps = [
        "fbsource//third-party/googletest:gtest",
        ":config_factory",
        ":hw_packet_utils",
        "//fboss/agent:fboss-error",
        "//fboss/agent:fboss-types",
        "//fboss/agent:hw_switch",
        "//fboss/agent:platform_base",
        "//fboss/agent/hw:hardware_stats-cpp2-types",
        "//fboss/agent/hw/switch_asics:switch_asics",
        "//fboss/agent/test:ecmp_helper",
        "//fboss/agent/test/utils:qos_test_utils",
        "//fboss/lib:common_utils",
        "//folly:network_address",
        "//folly/logging:logging",
    ],
)

cpp_library(
    name = "load_balancer_utils",
    srcs = [
        "LoadBalancerUtils.cpp",
    ],
    exported_deps = [
        "//fboss/agent:fboss-types",
        "//fboss/agent:hw_switch",
        "//fboss/agent:platform_base",
        "//fboss/agent/hw/switch_asics:switch_asics",
        "//fboss/agent/state:state",
        "//fboss/agent/test/utils:load_balancer_test_utils",
    ],
)

cpp_library(
    name = "prod_config_utils",
    srcs = [
        "HwTestProdConfigUtils.cpp",
    ],
    exported_deps = [
        ":hw_copp_utils",
        ":load_balancer_utils",
        "//fboss/agent:fboss-types",
        "//fboss/agent:hw_switch",
        "//fboss/agent/hw/switch_asics:switch_asics",
        "//fboss/agent/platforms/common:platform_mapping",
        "//fboss/agent/test/utils:olympic_qos_utils",
    ],
)

cpp_library(
    name = "teflow_utils",
    srcs = [
        "HwTeFlowTestUtils.cpp",
    ],
    exported_deps = [
        ":config_factory",
        "//fboss/agent/state:state",
        "//folly:network_address",
    ],
)

hw_test_common_srcs = [
    "HwVerifyPfcConfigInHwTest.cpp",
    "HwAclStatTests.cpp",
    "HwTestFabricUtils.cpp",
    "HwFlexPortTests.cpp",
    "HwEcmpTrunkTests.cpp",
    "HwEmptyTest.cpp",
    "HwLabelEdgeRouteTest.cpp",
    "HwLabelSwitchRouteTest.cpp",
    "HwLinkStateDependentTest.cpp",
    "HwMirrorTests.cpp",
    "HwPortProfileTests.cpp",
    "HwPortStressTests.cpp",
    "HwPtpTcTests.cpp",
    "HwTrunkTests.cpp",
    "HwRouteTests.cpp",
    "HwTest.cpp",
    "HwVlanTests.cpp",
    "HwSplitAgentTest.cpp",
    "HwSwitchStateReplayTest.cpp",
    "HwTestFullHashedPacketsForSaiTomahawk.cpp",
    "HwTestFullHashedPacketsForSaiTrident2.cpp",
    "HwTestFullHashedPacketsForTomahawk.cpp",
    "HwTestFullHashedPacketsForTomahawk3.cpp",
    "HwTestFullHashedPacketsForTomahawk4.cpp",
    "HwTestFullHashedPacketsForTrident2.cpp",
    "HwHashPolarizationTestUtils.cpp",
    "HwFlowletSwitchingTests.cpp",
    "HwTestPfcUtils.cpp",
]

hw_test_asic_only_srcs = hw_test_common_srcs + [
    "HwTeFlowTests.cpp",
    "HwAsicDefaultProgrammingTests.cpp",
    "HwParityErrorTest.cpp",
    "dataplane_tests/facebook/HwAlpmStressTests.cpp",
]

hw_dataplane_test_srcs = [
    "dataplane_tests/HwHashConsistencyTest.cpp",
    "dataplane_tests/HwHashPolarizationTests.cpp",
    "dataplane_tests/HwInPauseDiscardsTests.cpp",
    "dataplane_tests/HwLoadBalancerTests.cpp",
    "dataplane_tests/HwLoadBalancerTestsV6Flowlet.cpp",
    "dataplane_tests/HwMPLSTests.cpp",
    "dataplane_tests/HwProdInvariantHelper.cpp",
    "dataplane_tests/HwProdInvariantTests.cpp",
    "dataplane_tests/HwPacketSendTests.cpp",
    "dataplane_tests/HwL3Tests.cpp",
    "dataplane_tests/HwSflowTests.cpp",
    "dataplane_tests/HwTrunkLoadBalancerTests.cpp",
    "dataplane_tests/HwTeFlowTrafficTests.cpp",
    "dataplane_tests/HwRouteStatTests.cpp",
]

embed_resources(
    name = "golden_data",
    add_map = True,
    header_path = "fboss/agent/hw/test",
    namespace = None,
    resources = glob(["golden/**/*.csv"]),
    visibility = [
        "PUBLIC",
    ],
)

cpp_library(
    name = "hw_switch_test",
    srcs = hw_test_asic_only_srcs + hw_dataplane_test_srcs,
    link_whole = True,
    undefined_symbols = True,
    exported_deps = [
        "fbsource//third-party/googletest:gtest",
        "fbsource//third-party/re2:re2",
        ":config_factory",
        ":golden_data",
        ":hw_copp_utils",
        ":hw_packet_utils",
        ":hw_qos_utils",
        ":hw_switch_ensemble_factory",
        ":hw_test_acl_utils",
        ":hw_test_ecmp_utils",
        ":hw_test_flowlet_switching_utils",
        ":hw_test_mirror_utils",
        ":hw_test_mpls_utils",
        ":hw_test_neighbor_utils",
        ":hw_test_packet_snooper",
        ":hw_test_packet_trap_entry",
        ":hw_test_port_utils",
        ":hw_test_ptp_tc_utils",
        ":hw_test_route_utils",
        ":hw_test_tam_utils",
        ":hw_test_te_flow_utils",
        ":hw_test_trunk_utils",
        ":hw_test_udf_utils",
        ":hw_vlan_utils",
        ":load_balancer_utils",
        ":phy_capabilities",
        ":prod_config_factory",
        ":prod_config_utils",
        ":teflow_utils",
        "//fb303:service_data",
        "//fb303:thread_cached_service_data",
        "//fboss/agent:address_utils",
        "//fboss/agent:apply_thrift_config",
        "//fboss/agent:asic_utils",
        "//fboss/agent:constants",
        "//fboss/agent:fboss-error",
        "//fboss/agent:fboss-types",
        "//fboss/agent:gtest_defs",
        "//fboss/agent:hw_switch",
        "//fboss/agent:hwswitchcallback",
        "//fboss/agent:lacp_types",
        "//fboss/agent:load_agent_config",
        "//fboss/agent:packet",
        "//fboss/agent:platform_base",
        "//fboss/agent:route_update_wrapper",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent:switchid_scope_resolver",
        "//fboss/agent:validated_shell_commands-cpp2-types",
        "//fboss/agent/hw:hardware_stats-cpp2-types",
        "//fboss/agent/hw:hw_switch_fb303_stats",
        "//fboss/agent/hw/switch_asics:switch_asics",
        "//fboss/agent/if:common-cpp2-types",
        "//fboss/agent/if:mpls-cpp2-types",
        "//fboss/agent/packet:packet_factory",
        "//fboss/agent/packet:pktutil",
        "//fboss/agent/state:label_forwarding_action",
        "//fboss/agent/state:state",
        "//fboss/agent/test:ecmp_helper",
        "//fboss/agent/test:linkstate_toggler",
        "//fboss/agent/test:resourcelibutil",
        "//fboss/agent/test:trunk_utils",
        "//fboss/agent/test/utils:agent_hw_test_constants",
        "//fboss/agent/test/utils:config_utils",
        "//fboss/agent/test/utils:dscp_marking_utils",
        "//fboss/agent/test/utils:ecmp_dataplane_test_util",
        "//fboss/agent/test/utils:load_balancer_test_runner_h",
        "//fboss/agent/test/utils:load_balancer_test_utils",
        "//fboss/agent/test/utils:pfc_test_utils",
        "//fboss/agent/test/utils:port_stats_test_utils",
        "//fboss/agent/test/utils:queue_per_host_test_utils",
        "//fboss/agent/test/utils:stats_test_utils",
        "//fboss/agent/test/utils:trap_packet_utils",
        "//fboss/agent/test/utils:udf_test_utils",
        "//fboss/lib:common_utils",
        "//fboss/lib/phy:phy_utils",
        "//folly:file_util",
        "//folly:format",
        "//folly:network_address",
        "//folly:range",
        "//folly:singleton",
        "//folly:string",
        "//folly/io:iobuf",
        "//folly/json:dynamic",
        "//folly/logging:logging",
    ],
    exported_external_deps = [
        ("boost", None, "boost_container"),
    ],
)

cpp_library(
    name = "fake_hw_switch_test",
    srcs = hw_test_common_srcs,
    link_whole = True,
    undefined_symbols = True,
    exported_deps = [
        "fbsource//third-party/googletest:gtest",
        ":config_factory",
        ":hw_copp_utils",
        ":hw_packet_utils",
        ":hw_switch_ensemble_factory",
        ":hw_test_acl_utils",
        ":hw_test_ecmp_utils",
        ":hw_test_flowlet_switching_utils",
        ":hw_test_mirror_utils",
        ":hw_test_mpls_utils",
        ":hw_test_port_utils",
        ":hw_test_ptp_tc_utils",
        ":hw_test_route_utils",
        ":hw_test_te_flow_utils",
        ":hw_test_trunk_utils",
        ":hw_test_udf_utils",
        ":hw_vlan_utils",
        ":load_balancer_utils",
        ":phy_capabilities",
        ":prod_config_factory",
        "//fboss/agent:address_utils",
        "//fboss/agent:apply_thrift_config",
        "//fboss/agent:constants",
        "//fboss/agent:fboss-error",
        "//fboss/agent:fboss-types",
        "//fboss/agent:gtest_defs",
        "//fboss/agent:hw_switch",
        "//fboss/agent:hwswitchcallback",
        "//fboss/agent:platform_base",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent:switchid_scope_resolver",
        "//fboss/agent/hw:hardware_stats-cpp2-types",
        "//fboss/agent/hw/switch_asics:switch_asics",
        "//fboss/agent/if:common-cpp2-types",
        "//fboss/agent/if:mpls-cpp2-types",
        "//fboss/agent/packet:packet_factory",
        "//fboss/agent/packet:pktutil",
        "//fboss/agent/state:label_forwarding_action",
        "//fboss/agent/state:state",
        "//fboss/agent/test:ecmp_helper",
        "//fboss/agent/test:linkstate_toggler",
        "//fboss/agent/test:trunk_utils",
        "//fboss/agent/test/utils:agent_hw_test_constants",
        "//fboss/agent/test/utils:pfc_test_utils",
        "//fboss/agent/test/utils:port_stats_test_utils",
        "//fboss/agent/test/utils:stats_test_utils",
        "//fboss/agent/test/utils:udf_test_utils",
        "//fboss/lib:common_utils",
        "//fboss/lib/phy:phy_utils",
        "//folly:file_util",
        "//folly:network_address",
        "//folly:range",
        "//folly:singleton",
        "//folly/io:iobuf",
        "//folly/json:dynamic",
        "//folly/logging:logging",
    ],
)

cpp_library(
    name = "hw_pfc_utils",
    srcs = [
        "dataplane_tests/HwTestPfcUtils.cpp",
    ],
    undefined_symbols = True,
    exported_deps = [
        ":config_factory",
        "//fboss/agent:fboss-types",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent/hw/switch_asics:switch_asics",
        "//fboss/lib/platforms:platform_mode",
        "//folly/logging:logging",
    ],
)

cpp_library(
    name = "prod_config_factory",
    srcs = [
        "ProdConfigFactory.cpp",
    ],
    exported_deps = [
        ":config_factory",
        ":hw_copp_utils",
        ":hw_pfc_utils",
        "//fboss/agent:asic_utils",
        "//fboss/agent:fboss-error",
        "//fboss/agent:hw_switch",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent/hw/switch_asics:switch_asics",
        "//fboss/agent/test/utils:dscp_marking_utils",
        "//fboss/agent/test/utils:load_balancer_test_utils",
        "//fboss/agent/test/utils:network_ai_qos_utils",
        "//fboss/agent/test/utils:olympic_qos_utils",
        "//fboss/agent/test/utils:queue_per_host_test_utils",
    ],
)

cpp_library(
    name = "hw_switch_ensemble_factory",
    headers = ["HwSwitchEnsembleFactory.h"],
    exported_deps = [
        ":config_factory",
    ],
)

cpp_library(
    name = "phy_capabilities",
    headers = ["PhyCapabilities.h"],
    exported_deps = [
    ],
)

cpp_library(
    name = "hw_test_packet_trap_entry",
    headers = ["HwTestPacketTrapEntry.h"],
    exported_deps = [
        "//fboss/agent:fboss-types",
        "//folly:network_address",
    ],
)

cpp_library(
    name = "hw_test_te_flow_utils",
    headers = ["HwTestTeFlowUtils.h"],
    exported_deps = [
        "//fboss/agent:hw_switch",
    ],
)

cpp_library(
    name = "hw_test_ecmp_utils",
    headers = ["HwTestEcmpUtils.h"],
    exported_deps = [
        "//fboss/agent:fboss-types",
        "//folly:network_address",
    ],
)

cpp_library(
    name = "hw_test_port_utils",
    srcs = ["HwTestPortUtils.cpp"],
    undefined_symbols = "True",  # The sai/bcm implementations will define some functions
    exported_deps = [
        "//fboss/agent:fboss-error",
        "//fboss/agent:fboss-types",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent/test/utils:port_test_utils",
        "//fboss/qsfp_service/if:transceiver-cpp2-types",
        "//thrift/lib/cpp/util:enum_utils",
    ],
)

cpp_library(
    name = "hw_test_ptp_tc_utils",
    headers = ["HwTestPtpTcUtils.h"],
    exported_deps = [
        "//fboss/agent:fboss-types",
        "//folly:network_address",
    ],
)

cpp_library(
    name = "hw_test_udf_utils",
    headers = ["HwTestUdfUtils.h"],
    exported_deps = [
        ":load_balancer_utils",
        "//fboss/agent:fboss-types",
        "//fboss/agent:hw_switch",
    ],
)

cpp_library(
    name = "hw_test_flowlet_switching_utils",
    headers = ["HwTestFlowletSwitchingUtils.h"],
    exported_deps = [
        "//fboss/agent:hw_switch",
    ],
)

cpp_library(
    name = "hw_test_acl_utils",
    srcs = ["HwTestAclUtils.cpp"],
    exported_deps = [
        "//fboss/agent:hw_switch",
        "//fboss/agent/state:state",
        "//fboss/agent/test/utils:acl_test_utils",
    ],
)

cpp_library(
    name = "hw_test_fabric_utils",
    srcs = ["HwTestFabricUtils.cpp"],
    undefined_symbols = "True",  # The sai/bcm implementations will define some functions
)

cpp_library(
    name = "hw_test_copp_utils",
    srcs = ["HwTestCoppUtils.cpp"],
    undefined_symbols = "True",  # The sai/bcm implementations will define some functions
    exported_deps = [
        "fbsource//third-party/googletest:gtest",
        ":hw_packet_utils",
        "//fboss/agent:fboss-types",
        "//fboss/agent:hw_switch",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent/hw:hardware_stats-cpp2-types",
        "//fboss/agent/hw/switch_asics:switch_asics",
        "//fboss/agent/state:state",
        "//fboss/agent/test/utils:copp_test_utils",
        "//folly:network_address",
        "//folly/logging:logging",
    ],
)

cpp_library(
    name = "hw_test_route_utils",
    headers = ["HwTestRouteUtils.h"],
    exported_deps = [
        "//fboss/agent:hw_switch",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent/if:ctrl-cpp2-types",
        "//folly:network_address",
    ],
)

cpp_library(
    name = "hw_test_neighbor_utils",
    headers = ["HwTestNeighborUtils.h"],
    exported_deps = [
        "//fboss/agent:fboss-types",
        "//folly:network_address",
    ],
)

cpp_library(
    name = "hw_test_mpls_utils",
    headers = ["HwTestMplsUtils.h"],
    exported_deps = [
        ":config_factory",
        "//fboss/agent:fboss-types",
        "//fboss/agent/state:label_forwarding_action",
        "//fboss/agent/test:ecmp_helper",
    ],
    exported_external_deps = [
        "boost",
        ("boost", None, "boost_container"),
    ],
)

cpp_library(
    name = "hw_vlan_utils",
    headers = ["HwVlanUtils.h"],
    exported_deps = [
        "//fboss/agent:fboss-types",
    ],
)

cpp_library(
    name = "hw_test_trunk_utils",
    headers = ["HwTestTrunkUtils.h"],
    exported_deps = [
        "//fboss/agent:fboss-types",
        "//fboss/agent:hw_switch",
    ],
)

cpp_library(
    name = "hw_test_mirror_utils",
    headers = ["HwTestMirrorUtils.h"],
    exported_deps = [
        "//fboss/agent:hw_switch",
    ],
)

cpp_library(
    name = "hw_test_pfc_utils",
    headers = ["HwTestPfcUtils.h"],
    exported_deps = [
        "//fboss/agent:hw_switch",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent/state:state",
    ],
)

cpp_library(
    name = "hw_test_tam_utils",
    headers = ["HwTestTamUtils.h"],
)

cpp_library(
    name = "hw_test_aqm_utils_headers",
    headers = ["dataplane_tests/HwTestAqmUtils.h"],
    exported_deps = [
        ":config_factory",
        "//fboss/agent:fboss-types",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent/hw/switch_asics:switch_asics",
    ],
)

cpp_library(
    name = "hw_test_aqm_utils",
    srcs = ["dataplane_tests/HwTestAqmUtils.cpp"],
    headers = ["dataplane_tests/HwTestAqmUtils.h"],
    undefined_symbols = "True",  # The sai/bcm implementations will define some functions.
    exported_deps = [
        "fbsource//third-party/googletest:gtest",
        ":config_factory",
        "//fboss/agent:fboss-types",
        "//fboss/agent:switch_config-cpp2-types",
        "//fboss/agent/hw/switch_asics:switch_asics",
        "//fboss/agent/test/utils:aqm_test_utils",
    ],
)

cpp_library(
    name = "hw_test_thrift_handler_h",
    headers = [
        "HwTestThriftHandler.h",
    ],
    exported_deps = [
        "//fboss/agent:fboss-error",
        "//fboss/agent:hw_switch",
        "//fboss/agent:switch_state-cpp2-types",
        "//fboss/agent/if:agent_hw_test_ctrl-cpp2-services",
    ],
)
